home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / basic / psljii2.bas < prev    next >
BASIC Source File  |  1990-03-14  |  1KB  |  44 lines

  1.     REM
  2.     DEFINT I-N
  3.     REM $INCLUDE: 'qb.bi'
  4.     'for interrrupt routines (use qbx.bi for BC7)
  5.     DIM inregs AS RegTypeX
  6.     DIM outregs AS RegTypeX
  7.     ON KEY(10) GOSUB 100
  8.     KEY(10) ON
  9. REM--stick the main program here to generate the screen and
  10. REM--then hit F10.  Then wait and wait, this program is not fast.
  11.     STOP
  12.     REM--laserjet printscreen routine
  13.     REM--it is set for screen 12 (640 x 480) but should work
  14.     REM--for any mode by changing nxrange, nyrange and the screen mode
  15. 100     nxrange = 640
  16.     nyrange = 480
  17.     SCREEN 12
  18.     VIEW
  19.     WINDOW (0, 0)-(nxrange - 1, nyrange - 1)
  20.     c1% = 4                      'this is number of points per pixel
  21.     OPEN "lpt1:" FOR RANDOM AS #7
  22.     WIDTH #7, 255
  23.     PRINT #7, CHR$(27); "E";
  24.     inregs.ax = &HD00                       'for reading pixel
  25.     inregs.bx = 1                           'page #
  26.     FOR i = 1 TO nxrange - 1
  27.         FOR i1 = 1 TO nyrange - 1
  28.         inregs.cx = i                   'pixel column #
  29.         inregs.dx = i1                  'pixel row #
  30.         CALL INTERRUPTX(&H10, inregs, outregs)          'video
  31.         IF (outregs.ax AND &HFF) > 0 THEN           'just want AL
  32.             PRINT #7, CHR$(27); "*p"; (nyrange - i1) * c1%; "x"; (nxrange - i) * c1%; "Y";
  33.             PRINT #7, CHR$(27); "*c"; c1%; "A";
  34.             PRINT #7, CHR$(27); "*c"; c1%; "B";
  35.             PRINT #7, CHR$(27); "*c0P";
  36.             END IF
  37. nxt:            NEXT i1
  38.     NEXT i
  39.     PRINT #7, CHR$(27); "E";
  40.     CLOSE #7
  41.     RETURN
  42.     END
  43.  
  44.